home *** CD-ROM | disk | FTP | other *** search
- ;-------------------------gmessout routine begins--------------------------+
- ; NAME GMESSOUT
- ;
- ; from BLUEBOOK OF ASSEMBLY ROUTINES FOR IBM PC & XT.
- ; page : 154
-
- ; ROUTINE FOR PRINTING A STRING ON THE GRAPHICS SCREEN
- ;
- ; FUNCTION: This routine prints a messgae on the graphics screen, using
- ; the SCHAR or RCHAR routines. The message terminates in a zero.
- ;
- ; INPUT: Upon entry:
- ;
- ; address of message is in SI
- ; x-coord of upper LH corner is in xmess
- ; y-coord of upper LH corner is in ymess
- ; horiz magnitude of characters is in xmagn
- ; vert magnitude of characters is in xmagn
- ; color of chars is in color
- ; choice of fonts (0=stroke, 1=raster) is in font
- ;
- ; OUTPUT: Just to the screen
- ;
- ; REGISTERS USED: None modified
- ;
- ; SEGMENTS REFERENCED: Upon entry ES must point to the video RAM at
- ; 0B8000h and DS must point to the data segment used by the point-plot,
- ; box-filling, line-drawing and stroke character routines.
- ;
- ; ROUTINES CALLED: SCHAR or RCHAR
- ;
- ; SPECIAL NOTES: No bounds ;hecking is performed. Unpredictable results
- ; will occur if the horizontal or vertical magnitude is too large.
- ;
- ; ROUTINE TO PRINT A MESSAGE TO THE GRAPHICS SCREEN
- ;
- gmessout proc far
- ;
- ; get (x,y) location of message on screen
- mov ax,xmess ; get x-coord on screen
- mov x0,ax ; for first char
- mov ax,ymess ; get y-coord on screen
- mov y0,ax ; for first char
- cld ; forward direction
- ;
- ; main loop through characters of the message
- gmessloop:
- cld ; forward direction
- lodsb ; get the ASCII code
- cmp al,0 ; test for end of string
- je gmessexit
- ;
- ; check for fonts
- font0:
- cmp font,0 ; use font 0 ?
- jne nextchar
- call rchar ; plot raster characters
- ;
- nextchar:
- mov al,8 ; char cell width
- mov cl,xmagn ; times horizontal magnitude
- mul cl ; multiply
- add x0,ax ; add to location of previous char
- ;
- jmp gmessloop ; loop for next char
- ;
- gmessexit:
- ret ; return
- ;
- gmessout endp
- ;-------------------------gmessout routine ends---------------------------+